/* 
** The Header Media Queries **
** Tweak as per your needs **
*/

$small: 680px;

.brand {
  font-weight: bold;
  font-size: 20px;
}

.site-header {
  position: relative;
  background-color: #def7ff;
}

.site-header__wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-header__start {
  display: flex;
  align-items: center;

  > * + * {
    margin-left: 1rem;
  }
}

.site-header__end {
  @media (max-width: $small - 1) {
    flex: 0 0 100%;
    order: 2;
    margin-top: 1rem;
  }
}

.nav__wrapper {
  position: fixed;
  top: 66px;
  left: 0;
  width: Max(220px, 20%);
  bottom: 0;
  z-index: 1;
  visibility: hidden;
  opacity: 0;
  transform: translateX(-100%);
  background-color: #d9f0f7;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  display: block;

  &.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  @media (max-width: $small - 1) {
    top: 101px;
    /* Use a CSS variable and get JS help */
  }
}

.nav__item {
  border-bottom: 1px solid rgba(#000, 0.2);

  a {
    display: block;
    padding: 1.5rem 1rem;
  }
}

.sub-nav {
  display: flex;
  flex-wrap: wrap;

  li:not(:last-child) {
    margin-right: 1.5rem;
  }

  @media (max-width: $small - 1) {
    background: rgba(#000, 0.1);
    margin: 0 -1rem -1rem;
    padding: 1rem;
  }
}

.search {
  display: flex;
}

.search__toggle {
  appearance: none;
  order: 1;
  font-size: 0;
  width: 34px;
  height: 34px;
  background: url("../img/header-3/search.svg") center/22px no-repeat;
  border: 0;

  @media (max-width: $small - 1) {
    position: absolute;
    right: 1rem;
    top: 0.65rem;
  }

  &.active {
    background: url("../img/header-5/close.svg") center/22px no-repeat;
  }

  @media (min-width: $small) {
    display: none;
  }
}

.search__form {
  display: none;

  &.active {
    display: block;
  }

  @media (min-width: $small) {
    display: block;
  }

  @media (max-width: $small - 1) {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: red;

    input {
      width: 100%;
    }
  }

  input {
    min-width: 200px;
    appearance: none;
    border: 0;
    background-color: #fff;
    border-radius: 0;
    font-size: 16px;
    padding: 0.5rem;

    @media (max-width: $small - 1) {
      border-bottom: 1px solid #979797;
    }
  }
}
